<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>tfw</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<style type="text/css">
	.layui-fluid{width: 95%;}
	.box_div{text-align: center;height: 80px;border: 1px solid gray;margin: 10px;border-radius: 5px;padding: 5px;}
	.box_div:hover{border: 2px solid gray;}
	.layui-col-sm3{margin: 5px;}
	.from-name-label{width: 150px!important;}
</style>
<link rel="stylesheet" href="/tfw/layui-v2.4.5/layui/css/layui.css" />
<script type="text/javascript" src="/tfw/jquery.min.js"></script>

<!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
<!--[if lt IE 9]>
  <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
  <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
<![endif]--> 

</head>
<body>

<form class="layui-form layui-form-pane" action="/tfw/save/tfw" id="addWindow">
  	<input type="hidden" name="id" th:value="${tfw?.id}">
  	<input type="hidden" name="createTime" th:value="${#dates.format(tfw?.createTime, 'yyyy-MM-dd HH:mm:ss')}">
  	
	<div class="layui-col-sm3">
		<label class="layui-form-label from-name-label">
			名称缩写&nbsp;&nbsp;<span class="layui-badge-dot"></span>
		</label>
		<div class="layui-input-inline">
			<input type="text" th:value="${tfw?.nameAcronym}" name="nameAcronym" lay-verify="required" placeholder="请输入名称缩写" autocomplete="off" class="layui-input">
		</div>
	</div>

	<div class="layui-col-sm3">
		<label class="layui-form-label from-name-label">
			英文名称&nbsp;&nbsp;<span class="layui-badge-dot"></span>
		</label>
		<div class="layui-input-inline">
			<input type="text" th:value="${tfw?.nameEn}" name="nameEn" lay-verify="required" placeholder="请输入英文名称" autocomplete="off" class="layui-input">
		</div>
	</div>
	
	<div class="layui-col-sm3">
		<label class="layui-form-label from-name-label">中文名称</label>
		<div class="layui-input-inline">
			<input type="text" th:value="${tfw?.nameZh}" name="nameZh" placeholder="请输入中文名称" autocomplete="off" class="layui-input">
		</div>
	</div>

	<div class="layui-col-sm3">
		<label class="layui-form-label from-name-label">第一次发布时间</label>
		<div class="layui-input-inline">
			<input type="text" th:value="${#dates.format(tfw?.beginTime, 'yyyy-MM-dd')}" name="beginTime" id="beginTime" placeholder="请输入第一次发布时间" autocomplete="off" class="layui-input">
		</div>
	</div>
	
	<div class="layui-col-sm3">
		<label class="layui-form-label from-name-label">最近更新时间</label>
		<div class="layui-input-inline">
			<input type="text" th:value="${#dates.format(tfw?.lastUpdateTime, 'yyyy-MM-dd')}" name="lastUpdateTime" id="lastUpdateTime"  placeholder="请输入最近更新时间" autocomplete="off" class="layui-input">
		</div>
	</div>

	<div class="layui-col-sm3">
		<label class="layui-form-label  from-name-label">操作系统</label>
		<div class="layui-input-inline">
			<select name="osCode">
				<option th:each="oo,index : ${os}" th:value="${oo.code}" th:text="${oo.name}"
					th:selected="${tfw?.osCode == oo.code} ? 'true' : 'false'"
				></option>
			</select>
		</div>
	</div>

	<div class="layui-col-sm3">
		<label class="layui-form-label  from-name-label">授权协议</label>
		<div class="layui-input-inline ">
			<select name="licenseCode">
				<option th:each="li,index : ${license}" th:value="${li.code}" th:text="${li.name}"
					th:selected="${tfw?.licenseCode == li.code} ? 'true' : 'false'"
				></option>
			</select>
		</div>
	</div>

	<div class="layui-col-sm3">
		<label class="layui-form-label from-name-label">开发语言</label>
		<div class="layui-input-inline">
			<select name="languageCode">
				<option th:each="lan,index : ${language}" th:value="${lan.code}" th:text="${lan.name}"
					th:selected="${tfw?.languageCode == lan.code} ? 'true' : 'false'"
				></option>
			</select>
		</div>
	</div>

	<div class="layui-col-sm3">
		<label class="layui-form-label from-name-label">技术标签</label>
		<div class="layui-input-inline">
			<select name="tagsCode">
				<option th:each="tag,index : ${tags}" th:value="${tag.code}" th:text="${tag.name}"
					th:selected="${tfw?.tagsCode == tag.code} ? 'true' : 'false'"
				></option>
			</select>
		</div>
	</div>

	<div class="layui-col-sm3">
		<label class="layui-form-label from-name-label">开发厂商</label>
		<div class="layui-input-inline">
			<select name="manufacturerCode">
				<option th:each="tmf,index : ${allTmf}" th:value="${tmf.id}" th:text="${tmf.mName}"
					th:selected="${tfw?.manufacturerCode == tmf.id} ? 'true' : 'false'"
				></option>
			</select>
		</div>
	</div>

	<div class="layui-col-sm3">
		<label class="layui-form-label from-name-label">技术分类</label>
		<div class="layui-input-inline">
			<select name="typeCode">
				<option th:each="tp,index : ${type}" th:value="${tp.code}" th:text="${tp.name}"
					th:selected="${tfw?.typeCode == tp.code} ? 'true' : 'false'"
				></option>
			</select>
		</div>
	</div>

	<div class="layui-col-sm3">
		<label class="layui-form-label from-name-label">技术熟练度</label>
		<div class="layui-input-inline">
			<select name="skilledCode">
				<option th:each="sk,index : ${skilled}" th:value="${sk.code}" th:text="${sk.name} + '_' + ${sk.code} + '级'"
					th:selected="${tfw?.skilledCode == sk.code} ? 'true' : 'false'"
				></option>
			</select>
		</div>
	</div>

	<div class="layui-col-sm3">
		<label class="layui-form-label from-name-label">技术所属国家</label>
		<div class="layui-input-inline">
			<select name="countryCode">
				<option th:each="cty,index : ${country}" th:value="${cty.code}" th:text="${cty.name} + '_' + ${cty}"
					th:selected="${tfw?.countryCode == cty.code} ? 'true' : 'false'"
				></option>
			</select>
		</div>
	</div>
	
	<div class="layui-form-item" style="margin: 5px;">
	    <label class="layui-form-label from-name-label">源码地址</label>
	    <div class="layui-input-inline" style="width: 62.5%;">
	      <input type="text" th:value="${tfw?.sourcesUrl}" name="sourcesUrl" autocomplete="off" placeholder="请输入源码地址, 如git地址, 多个地址以逗号隔开" class="layui-input">
	    </div>
  	</div>

	<div class="layui-form-item" style="margin: 5px;">
	    <label class="layui-form-label from-name-label">官方地址</label>
	    <div class="layui-input-inline" style="width: 62.5%;">
	      <input type="text" th:value="${tfw?.uccnUrl}" name="uccnUrl" autocomplete="off" placeholder="请输入官方地址, 多个地址以逗号隔开" class="layui-input">
	    </div>
  	</div>
	
	<div class="layui-col-sm3">
		<label class="layui-form-label from-name-label">潮流度</label>
		<div class="layui-input-inline">
			<select name="popular">
				<option th:each="pop,index : ${popular}" th:value="${pop.code}" th:text="${pop.name}"
					th:selected="${tfw?.popular == pop.code} ? 'true' : 'false'"
				></option>
			</select>
		</div>
	</div>

	<div class="layui-col-sm3">
		<label class="layui-form-label from-name-label">论坛活跃度</label>
		<div class="layui-input-inline">
			<select name="forum">
				<option th:each="fo,index : ${forum}" th:value="${fo.code}" th:text="${fo.name}"
					th:selected="${tfw?.forum == fo.code} ? 'true' : 'false'"
				></option>
			</select>
		</div>
	</div>
	
	<div class="layui-col-sm3">
		<label class="layui-form-label from-name-label">是否开源</label>
		<div class="layui-input-inline">
			<input type="checkbox" name="openSources" title="开源"
				th:checked="${tfw?.openSources == 1} ? 'true' : 'false'"
			value="1" >
			<!-- <input type="checkbox" name="openSources" lay-skin="switch" lay-text="开启|关闭">
			<input type="radio" name="openSources" value="1" title="是" checked="">
			<input type="radio" name="openSources" value="0" title="否">  -->
		</div>
	</div>
	
	<div class="layui-form-item" style="margin: 5px;">
	    <label class="layui-form-label from-name-label">论坛网址</label>
	    <div class="layui-input-inline" style="width: 62.5%;">
	      	<input type="text" th:value="${tfw?.forumUrl}" name="forumUrl" autocomplete="off" placeholder="论坛网址" class="layui-input">
	    </div>
  	</div>

	<div class="layui-form-item" style="margin: 5px;">
	    <label class="layui-form-label from-name-label">简单描述</label>
	    <div class="layui-input-inline" style="width: 62.5%;">
	      	<input type="text" th:value="${tfw?.desction}" name="desction" autocomplete="off" placeholder="请输入描述" class="layui-input">
	    </div>
  	</div>
	
	<div class="layui-form-item layui-form-text" style="width: 70.3%;">
		<label class="layui-form-label">备注</label>
		<div class="layui-input-block">
			<textarea name="remark" th:text="${tfw?.remark}" placeholder="请输入备注" class="layui-textarea" ></textarea>
		</div>
	</div>
	
	<div class="layui-form-item">
		<button class="layui-btn" lay-submit="" lay-filter="submit_save" id="submit_save_id">跳转式提交</button>
		<button type="reset" class="layui-btn layui-btn-primary" id="reset_id">重置</button>
	</div>
</form>
<script type="text/javascript" src="/tfw/layui-v2.4.5/layui/layui.all.js"></script>
<script type="text/javascript">

layui.use(['form', 'layedit', 'laydate'], function(){
	var form = layui.form,
		layer = layui.layer,
		layedit = layui.layedit,
		laydate = layui.laydate;
	  
	  	//日期
	  	laydate.render({elem: '#beginTime'});
	  	laydate.render({elem: '#lastUpdateTime'});
	  
	  	//监听提交
		form.on('submit(submit_save)', function(data){
			$('#submit_save_id').attr("disabled", true);//将提交置为不可用
			$.ajax({
	            type : "post",
	            url : "/tfw/save/tfw",
	            data :data.field,
	            async : false,
	            dataType : "json",
	            success : function(response) {
	            	if("success" == response.msg) {
	            		layer.alert("保存成功", {title: '返回结果'});
	            		// $('#reset_id').trigger('click'); 重置内容
	            	} else if ("failed" == response.msg) {
	            		layer.alert("保存失败", {title: '返回结果'});
	            	} else {
	            		layer.alert("出现异常", {title: '返回结果'});
	            	}
	            	$('#submit_save_id').attr("disabled", false);//将提交置为可用
	            }
	        });
		    return false;
	  });
});	

</script>
</body>
</html>